package com.test.springboot3.springboot3testdemo1.converter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2024/7/31-下午8:07
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@Slf4j
public class CustomConverter implements Converter<String, String> {
  /**
   * @param source
   * @return
   */
  @Override
  public String convert(String source) {
    if (StringUtils.isEmpty(source)) {
      source = source.trim();
    }
    return source;
  }
}
